/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.store;

import java.sql.Date;
import java.sql.SQLException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.S250;
import queenb.net.entitybean.S350;
import queenb.web.util.PackageContants;

/**
 *
 * @author Nguyen Hung
 */
public class S350Store extends S350 {

     public List<S350> getListS350All(int pnFH000,int pnFH200,int pnFS350,int pnFS200,int pnFA000,int pnFN750,int pnFK100,String pvLOGIN) {
        try {
            DataStatement data = new DataStatement(PackageContants.LIST_S350, OracleTypes.CURSOR, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.INTEGER, pnFS350),
                        new Param(OracleTypes.INTEGER, pnFS200),
                        new Param(OracleTypes.INTEGER, pnFA000),
                        new Param(OracleTypes.INTEGER, pnFN750),
                        new Param(OracleTypes.INTEGER, pnFK100),
                       
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.find(data, S350.class);
        } catch (SQLException ex) {
            Logger.getLogger(S350Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(S350Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(S350Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }
    
    public int updateS350(int pnPS350, int pnFH000, int pnFH200, int pnFK100, int pnFA000, int pnFS200, int pnFS250, Date pdSD351, Date pdSD352, String pvSV353, int pnSN354, String pvSV355, String pvSV356, String pvSV357,double pnSN358, String pvLOGIN) {
        DataStatement dataStetament = new DataStatement(PackageContants.UPDATE_S350, OracleTypes.INTEGER, new Param[]{
                    new Param(OracleTypes.INTEGER, pnPS350),
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFK100),
                    new Param(OracleTypes.INTEGER, pnFA000),
                    new Param(OracleTypes.INTEGER, pnFS200),
                    new Param(OracleTypes.INTEGER, pnFS250),
                    new Param(OracleTypes.DATE, pdSD351),
                    new Param(OracleTypes.DATE, pdSD352),
                    new Param(OracleTypes.CHAR, pvSV353),
                    new Param(OracleTypes.INTEGER, pnSN354),
                    new Param(OracleTypes.CHAR, pvSV355),
                    new Param(OracleTypes.CHAR, pvSV356),
                    new Param(OracleTypes.CHAR, pvSV357),
                     new Param(OracleTypes.DOUBLE, pnSN358),
                    new Param(OracleTypes.CHAR, pvLOGIN),});
        try {
            return super.update(dataStetament, S350.class);
        } catch (SQLException ex) {
            Logger.getLogger(S350Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }
}
